﻿using Leadyo.WebService.ServiceWCF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace Leadyo.WebService
{
   public class ClientFactory
    {
        /// <summary>
        ///  Client对象
        /// </summary>
        /// <returns></returns>
       public static ServiceWCFClient CreateCommonServiceClient()
        {
            WSHttpBinding BINDING = new WSHttpBinding();
            ClientConfig.ReadBindingConfig(BINDING, "WSHttpBinding_IServiceWCF");//从配置文件(app.config)读取配置。            
            string endpoint = ClientConfig.GetSoapRemoteAddress("WSHttpBinding_IServiceWCF");
            return new ServiceWCFClient(BINDING, new EndpointAddress(endpoint));//构建WCF客户端实例
        }
    }
}
